<?php
session_start();

$id = $_GET['id'];

include 'dbconnect.php';

  // Check connection
if (mysqli_connect_errno())
  {
  //echo "alert'Failed to connect to MySQL: ' . mysqli_connect_error()";
  }
$number = $_SESSION['number'];
if ($number[0] == "+")
	$number[0] = "_";
$table = "SELECT * FROM activity".$number;
$result = mysqli_query($con, $table);

while($row = mysqli_fetch_array($result))
  {
  if ($row['id']==$id){
    $sql="UPDATE `activity$number` SET `seen` = '1' WHERE `activity$number`.`id` = '$id';";

     if (!mysqli_query($con,$sql))
     {
          echo('Error: ' . mysqli_error($con));
     } 
	break;
  }
  }

  
mysqli_close($con);
?>
